<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="h-ui-font/iconfont.min.css" />
		<link rel="stylesheet" type="text/css" href="css/jquery-weui.min.css" />
		<link rel="stylesheet" type="text/css" href="css/weui.min.css" />
		<script src="js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jquery-weui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/vue(1).js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			body {
				width: 100%;
				margin: 0px auto;
				min-width: 320px;
				max-width: 640px;
			}
			
			.top {
				width: 100%;
				height: 50px;
				min-width: 320px;
				max-width: 640px;
				line-height: 50px;
				color: white;
				font-size: 18px;
				text-indent: 5px;
				position: fixed;
				overflow: hidden;
				background-color: #0F88EB;
			}
			
			.top a {
				color: white;
				display: inline-block;
				margin-right: 10px;
			}
			
			.contents {
				width: 100%;
				padding-top: 50px;
				padding-bottom: 40px;
				overflow: auto;
				/*border: 1px solid red;*/
			}
			
			.weui-tabbar {
				min-width: 320px;
				max-width: 640px;
				height: 40px;
				position: fixed;
			}
			
			.weui-tabbar__icon {
				margin-top: -4px;
			}
			
			.active {
				color: rgba(0, 0, 255, 0.8) !important;
			}
			
			.weui-cells {
				margin-top: 5px;
			}
			
			.btn {
				width: 90%;
				height: 50px;
				margin: 0px auto;
				border-radius: 8px;
				text-align: center;
				margin-top: 50px;
				line-height: 50px;
				cursor: pointer;
				color: white;
				font-size: 18px;
				background-color: #0F88EB;
			}
		</style>
	</head>

	<body>
		<div class="top">
			<a href="index.html" class="Hui-iconfont Hui-iconfont-slider-left"></a>提问
		</div>
		<div class="contents">
			<div class="weui-cells">
				<div class="weui-cell">
					<div class="weui-cell__bd">
						<input class="weui-input" type="text" v-model="title" placeholder="请输入标题">
					</div>
				</div>
			</div>
			<div class="weui-cells">
				<div class="weui-cell">
					<div class="weui-cell__bd">
						<input class="weui-input" type="text" v-model="content" placeholder="添加问题的说明">
					</div>
				</div>
			</div>
			<div class="weui-cells">
				<div class="weui-cell">
					<div class="weui-cell__bd">
						<input class="weui-input" type="text" v-model="fenlei" placeholder="分类(前端、阅读、音乐、互联网、社交)">
					</div>
				</div>
			</div>
			<div class="weui-cells">
				<div class="weui-cell">
					<div class="weui-cell__bd">
						<input class="weui-input" type="number" v-model="pay" placeholder="悬赏金额（只能是数字）">
					</div>
				</div>
			</div>
			<div class="btn" v-on:click="fabiao()">发表问题</div>
		</div>

		<div class="weui-tabbar">
			<a href="shouye.html" class="weui-tabbar__item">
				<div class="weui-tabbar__icon">
					<i class="Hui-iconfont Hui-iconfont-canshu"></i>
				</div>
			</a>
			<a href="find.html" class="weui-tabbar__item">
				<div class="weui-tabbar__icon">
					<i class="Hui-iconfont Hui-iconfont-yanjing"></i>
				</div>
			</a>
			<a href="chart.html" class="weui-tabbar__item">
				<div class="weui-tabbar__icon">
					<i class="Hui-iconfont Hui-iconfont-xiaoxi1"></i>
				</div>
			</a>
			<a href="more.html" class="weui-tabbar__item">
				<div class="weui-tabbar__icon">
					<i class="Hui-iconfont Hui-iconfont-menu active"></i>
				</div>
			</a>
		</div>
	</body>
	<script type="text/javascript">
		var ss = sessionStorage.getItem("token");
		var dd = sessionStorage.getItem("appid");
		var year = new Date();
		var nian = year.getFullYear();
		var yue = (year.getMonth() + 1) < 10 ? "0" + (year.getMonth() + 1) : year.getMonth() + 1;
		var day = year.getDate() < 10 ? "0" + year.getDate() : year.getDate();
		var str1 = nian + "-" + yue + "-" + day;
		var vue = new Vue({
			el: "body",
			data: {
				title:"",
				content:"",
				fenlei:"",
				pay:"",
				json1: [],

			},
			methods: {
				fabiao: function() {
					if(sessionStorage.getItem("username")) {
						if($(".sendTieTxt").html() != "" && $(".sendTieTitle").html() != "") {
							$.ajax({
								type: "get",
								url: "http://v2.mashupcloud.cn/SQL/into_tie/",
								data: {
									appid: dd,
									token: ss,
									name: 'into_tie',
									_v1: vue.title,
									_v2: vue.content,
									_v3: sessionStorage.getItem("userid"),
									_v4: str1,
									_v5: vue.pay,
									_v6: vue.fenlei
								},
								success: function(json) {
									vue.json1=JSON.parse(json);
									console.log(vue.json1)
									obj = {
										title: vue.title,
										context: vue.content,
										user_id: sessionStorage.getItem("userid"),
										time: str1,
										money: vue.pay,
										fenlei: vue.fenlei
									}
									vue.json1.unshift(obj)
									location.href="index.html";
								}
							});
						}

					} else {
						location.href = "regist.login.html"
					}
				}
			}
		})
	</script>

</html>